<%@ page language="java" import="java.util.*"
	contentType="text/html;charset=gb2312" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<script language="javascript">
	function checkValidate() {
		//判断用户名是否为空  
		if (formt.username.value == "" || formt.username.value == null) {
			window.alert("用户名不能为空！！！");
			return false;
		}
		//判断密码是否为空  
		if (formt.password.value == "" || formt.password.value == null) {
			window.alert("密码不能为空！！！");
			return false;
		}
		if (formt.image.value == "" || formt.image.value == null) {
			window.alert("验证码不能为空！！！");
			return false;
		} else
			return true;
	}
</script>
<meta name="viewport" content="width=device-width, initial-scale=1">

<base href="<%=basePath%>">

<title>老师登录</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet"
		href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">	
	<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
	<script
		src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
	
</head>
<body>
	<form id="formt" name="formt" action="tloginaction.action"
		method="POST">
		<h1 align="center">教师登录</h1>
		<br />
		<center>
			<table border=1>
				<tr>
					<td>用户名（邮箱）：</td>
					<td><input type="text" name="username" size="20"
						maxlength="50" /></td>
				</tr>
				<tr>
					<td>密&nbsp;&nbsp;码：</td>
					<td><input type="password" name="password" size="20"
						maxlength="16" /></td>
				</tr>
				<tr>
					<td><input type="submit" name="submit" value="登陆"
						onclick="return checkValidate();" /></td>
					<td><input type="reset" name="Reset" value="重置" /></td>
				</tr>
			</table>
			<table><tr><td>
			<input name="image" type="text" id="image" title="验证码区分大小写" size="10"
				maxlength="4" /> <img src="image.jsp" alt="验证码" id="authCode"
				onclick="this.src='image.jsp?random='+Math.random()">
			<a href="#" onclick="myReload()">看不清，换一张</a>
			</td></tr></table>
		</center>
	</form>
	<script type="text/javascript">
		//用于刷新验证码  
		function myReload() {
			document.getElementById("authCode").src = document
					.getElementById("authCode").src
					+ "?random=" + new Date().getTime();
		}
	</script>
	<center>
	<table><tr><td>
	<a href="index.jsp"
		onclick="this.src='image.jsp?random='+Math.random()" id="button-3"
		data-role="button">返回</a></td></tr>
	</table></center>
</body>
</html>
